
import java.util.ArrayList;
import java.util.Scanner;

class METEORO {

    public static void main(String[] args) {
        int  n = 0, contmet = 0, conttest = 0;
        boolean diferente = false;
        ArrayList<Integer> saida = new ArrayList();
        Scanner entrada = new Scanner(System.in);
        do {

            int x1 = entrada.nextInt();
            int y1 = entrada.nextInt();
            int x2 = entrada.nextInt();
            int y2 = entrada.nextInt();
            if (x1 != 0 && y1 != 0 && x2 != 0 && y2 != 0) {
                diferente = true;
                n = entrada.nextInt();
            }else  {
                diferente=false;
            }
            while (n != 0) {
               int  x = entrada.nextInt();
               int y = entrada.nextInt();
                if (x >= x1 && x <= x2 && y <= y1 && y >= y2) {
                    contmet++;
                }
                n--;
            }
            if (diferente) {
                saida.add(contmet);
                contmet = 0;
            }

        } while (diferente);
        for (Integer result : saida) {
            conttest++;
            System.out.println("Teste " + conttest);
            System.out.println(result);
            System.out.println();
        }
    }
}
